package com.hspedu.homework;

import java.util.Scanner;

/**
 * @author DL5O
 * @version 1.0
 */
public class Homework4 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入字符串:");
        String str = sc.next();
        int numCnt = 0;
        int upCnt = 0;
        int lowCnt = 0;
        for (int i = 0; i < str.length(); i++) {
            char temp = str.charAt(i);
            if(temp >= '0' && temp <= '9'){
                numCnt++;
            }

            if (temp >= 'a' && temp <= 'z'){
                lowCnt++;
            }
            if (temp >= 'A' && temp <= 'Z'){
                upCnt++;
            }
        }

        System.out.println("数字:"+ numCnt +"\n小写字母:"+lowCnt +"\n大写字母:" + upCnt);
        /*
        请输入字符串:123456Abc
        数字:6
        小写字母:2
        大写字母:1
         */
    }
}
